package edu.bit.water.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.*;

import edu.bit.water.entity.LabelCleanProduce;
import edu.bit.water.service.LabelCleanProduceService;


/**
 * 这里对应数据库中Meta_assessment_indicator表的controller
 * 对应企业管理指标
 * @Author： Page
 */
@Controller
@RequestMapping("/label_clean_produce")
public class LabelCleanProduceController {

	@Autowired
	private LabelCleanProduceService LabelCleanProduceService = new LabelCleanProduceService();

	@ResponseBody
	@RequestMapping(value = "/select", method=RequestMethod.GET)
	public Map<String, Object>selectLabelCleanProduce() {
		Map<String, Object> result = new HashMap<>();
		List<LabelCleanProduce> list = LabelCleanProduceService.selectLabelCleanProduce();
		result.put("rows", list);
		return result;
	}

	@ResponseBody
	@RequestMapping("/insert")
	public Map<String, Object> insertLabelCleanProduce(LabelCleanProduce LabelCleanProduce) {
		//WasteWaterEva.showContent();
		LabelCleanProduce.dateChange();
		return LabelCleanProduceService.insertLabelCleanProduce(LabelCleanProduce);
	}

	/**
	 * 删除metaStandard
	 * author Page
	 */
	@ResponseBody
	@RequestMapping("/delete")
	public Map<String, Object> deleteLabelCleanProduce(@RequestBody List<String>LabelCleanProduces) {
		return LabelCleanProduceService.deleteLabelCleanProduce(LabelCleanProduces);
	}

	@ResponseBody
	@RequestMapping("/update")
	public Map<String, Object> updateMetaStandard(LabelCleanProduce LabelCleanProduce) {
		LabelCleanProduce.dateChange();
		Map<String, Object> result = LabelCleanProduceService.updateLabelCleanProduce(LabelCleanProduce);
		return result;
	}
}